def is_palindrome(num):
    num_s = str(num)
    num_s_pal = num_s[::-1]
    if num_s == num_s_pal:
        return True
    return False

# print(is_palindrome(9009))

palindromeList =[]
for x in range(100,1000):
    for y in range(100,1000):
        tmp = x * y
        if is_palindrome(tmp):
            palindromeList.append(tmp)

palindromeList.sort()
print(palindromeList[-1])